home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / errmon.arc / ERRMON.DOC < prev   
Text File  |  1985-09-03  |  12KB  |  297 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                   ERRMON 1.1
  8.  
  9.                               By Robert J. Newton
  10.  
  11.        After experiencing a variety of problems with the hard disk on
  12.        my AT, I decided that I wanted a more informative report of disk
  13.        I/O errors than that provided by DOS.  ERRMON is the result and
  14.        it did give me advance warning of total collapse of the infamous
  15.        CMI drive.
  16.  
  17.        ERRMON is a resident program which inserts itself in the INT 13
  18.        chain.  It then sits quietly watching for any error condition
  19.        returned by the disk driver.  When an error is detected, it
  20.        springs to life and prints an error message on the screen.  This
  21.        message is usually more informative than that provided by DOS. 
  22.        The failing command and location of the offending area of the
  23.        disk will also be displayed.  This information will appear as:
  24.  
  25.                        error message xxDxxCxxxxHxxSxxNxx
  26.  
  27.        where the first two digits are the command sent to the bios
  28.        driver and D, C, H and S are the Drive and the starting Cylinder,
  29.        Head and Sector of the INT 13 request and N is the number of
  30.        sectors requested.  The values are in hex; floppy drives will be
  31.        numbered 00, 01; hard drives will be numbered 80, 81.  Note that
  32.        if a multi-sector request was made (N>1) then the values for C, H
  33.        and S will indicate the starting sector, not the actual sector
  34.        causing the error.  The actual location of the error could be
  35.        found only by reading the controller registers, a very hardware
  36.        specific operation.  Also note that some of this information may
  37.        be meaningless for certain INT 13 operations.  After reporting,
  38.        ERRMON gracefully returns to the caller to let it do what it
  39.        wishes with the error.
  40.  
  41.        ERRMON will let you know when DOS makes a first retry.  However,
  42.        ERRMON does not scroll the screen.  This means that it is
  43.        possible that a second message will overlay the first and you
  44.        would not be aware of repeated retries.
  45.  
  46.        A word of caution.  ERRMON has been written to respond to the
  47.        error codes returned by the IBM BIOS disk drivers on the PC, XT
  48.        and AT as shown in the various BIOS listings.  Results with
  49.        other drivers are totally unknown although it might be assumed
  50.        that they map their error codes the same in order to achieve
  51.        compatibility.  There are no checks for machine or drive type.
  52.  
  53.        In addition, the errors defined for the PC/XT and AT fixed disk
  54.        drivers are not the same in all cases.  ERRMON responds to the
  55.        codes for both.  It is possible, but not likely, that say the AT
  56.        could through some glitch return an error code that is not
  57.        defined on the AT, but is on the XT.  Instead of displaying an
  58.        "Undefined error" message, ERRMON would display the message
  59.  
  60.                                        1
  61.  
  62.  
  63.  
  64.  
  65.  
  66.        defined for the XT.  This possibility was considered so remote
  67.        that it was not trapped.
  68.  
  69.        The only error that ERRMON does not respond to is applicable
  70.        only to the AT.  Its floppy disk driver may report an error that
  71.        is related to the dual nature of the AT's high capacity drives. 
  72.        This is not a true i/o error and is ignored by ERRMON.
  73.  
  74.        Many copy protected programs will cause ERRMON to display an
  75.        error message but the program will run normally.  The program is
  76.        deliberately causing the error as a part of its check for an
  77.        original distribution disk.  Other programs such as FORMAT,
  78.        DISKCOPY and DISKCOMP may report errors as a part of their
  79.        determining the type of disk with which they are dealing.
  80.  
  81.        It has been reported that certain Teac drives used with certain
  82.        drivers will return one or two error reports on any read attempt
  83.        of a drive that is not already spinning.  This is believed to be
  84.        due to the mechanical design of the Teac drive.  To quote from
  85.        the IBM BIOS listings, "On read accesses, no motor start delay is
  86.        taken, so that three retries are required on reads to ensure that
  87.        the problem is not due to motor start-up".  This means that DOS
  88.        must make at least one retry on every read access of these drives
  89.        unless the driver software has been written to make the retries,
  90.        a fact that has been hidden from you.  It has also been reported
  91.        that the design of these drives causes them to have problems with
  92.        some copy protection schemes.
  93.  
  94.        ERRMON's overhead is essentially nil, five instructions when
  95.        there is no error.  Approximately 1K of memory will be used,
  96.        depending on how much environment space is in use when it
  97.        is loaded.
  98.  
  99.        The video attribute for the error messages has been set to 0F,
  100.        intense white.  The messages will print in the lower right
  101.        corner of the screen.  You may change both of these by using
  102.        DEBUG.  The attribute byte is at offset 0332 and the screen line
  103.        is at offset 02E3.  Note that the screen line is relative to 0
  104.        so that the last line is hex 18, decimal 24.  For those with
  105.        MASM, you may change the EQUATEs at the beginning.  You may also
  106.        change the message text.  If you change the message text such
  107.        that the entire line would exceed the presently set width ERRMON
  108.        will truncate the line to the screen width.
  109.  
  110.        Installation is simple, just type errmon.  A successful
  111.        installation will return ERRORLEVEL 0, unsuccessful will return
  112.        255.  It can be installed by an AUTOEXEC.BAT, preferably before
  113.        anything else which might place itself in the INT 13 chain so
  114.        that it receives the register values returned by the disk device
  115.        driver.  You can use >nul to avoid the sign on message.
  116.  
  117.  
  118.  
  119.                                        2
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                                 Error messages
  127.  
  128.        Note that some of these errors are applicable to both floppy and
  129.        hard disks; others are applicable only to hard disks.  These
  130.        descriptions are by no means complete.
  131.  
  132.        Sense failure (PC/XT only)
  133.  
  134.        Status error (AT only) - The controller status register returned
  135.        an error condition, but the error register did not contain an
  136.        error code.
  137.  
  138.        Write fault (AT only) - Indicates a hardware problem with the
  139.        drive. 
  140.  
  141.        Undefined error - An error code was returned for which BIOS has
  142.        not defined an error.
  143.  
  144.        Drive not ready (AT only)
  145.  
  146.        No response - The time alloted for an operation expired without
  147.        a response from the drive, what DOS calls Drive not ready.
  148.  
  149.        Seek failure - An attempt to seek to the requested cylinder was
  150.        unsuccessful.  Assuming the cylinder number was valid for the
  151.        disk, this probably indicates a hardware problem.
  152.  
  153.        Controller failure - Probably indicates that the controller could
  154.        not successfully complete the requested command within the
  155.        alloted time.
  156.  
  157.        EEC corrected error - An information report that the controller's
  158.        EEC algorithm successfully corrected a soft data error.  You
  159.        should copy the file and delete the original if this happens
  160.        frequently to a file.
  161.  
  162.        Bad CRC/EEC on read - The sector could not be successfully read. 
  163.        This is the most common of all disk I/O errors, probably
  164.        outnumbering all others combined, and can have many causes:
  165.        defective media, dirty heads, misaligned drives, electrical
  166.        glitches ...  The controller itself may make several attempts to
  167.        read the sector before giving up with an error report and DOS
  168.        will make five retries before it gives up and finally (usually,
  169.        but not always) lets you know that a problem exists.  You may
  170.        still be able to recover the sector by answering the prompt with
  171.        R for retry a few times.  If you can read the sector, the file
  172.        should be copied and the original deleted, otherwise resort to
  173.        RECOVER.  The next write to the sector may "cure" the problem,
  174.        at least temporarily and unless there is physical damage to the
  175.        media.
  176.  
  177.  
  178.                                        3
  179.  
  180.  
  181.  
  182.  
  183.  
  184.        My experiences with the AT CMI drive show that the classic
  185.        failure is associated with bad crc/eec sectors which appear
  186.        rather suddenly in large numbers, possibly after a few days of
  187.        occasional errors which are overcome by retries.  The flawed
  188.        sectors can appear even in areas of the disk which have not been
  189.        written to except by the low level formatter.  Further, they
  190.        shift in location and number.  If this happens, it is best
  191.        not to delay, hoping that a low level reformat with the Advanced
  192.        Diagnostics or magic incantations will avoid future problems. 
  193.        Sooner or later it will happen again.  You may as well have the
  194.        drive replaced quickly even though the diagnostics report no
  195.        errors.
  196.  
  197.        Bad track (PC/XT only) - An operation was attempted on a track
  198.        flagged bad by the low level formatter.  Such areas should have
  199.        been marked bad in the FAT.
  200.  
  201.        Bad sector (AT only) - Similar to Bad track.
  202.  
  203.        DMA boundary crossed - This indicates a software problem;
  204.        DMA cannot operate across 64k segment boundaries.
  205.  
  206.        DMA overrun - The controller could not get DMA access; a retry
  207.        should succeed.
  208.  
  209.        Drive init failure - Probably indicates an attempt to initialize
  210.        an invalid drive number.
  211.  
  212.        Drive reset failure - An attempt to reset the drive system
  213.        failed.
  214.  
  215.        Sector not found -  The requested sector number could not be
  216.        found.  Assuming the values were valid, this indicates a flawed
  217.        disk.  Absent a very capable disk zapper and the knowledge of its
  218.        use, the only cure is a low level format.  It is also possible
  219.        that a disk made in one drive cannot be read in another because
  220.        one of them is out of alignment.
  221.  
  222.        Disk write protected - Take the tab off.  If there is no tab
  223.        the drive's sensors are probably bad.
  224.  
  225.        DAM not found - The Data Address Mark recorded before the data
  226.        area of each sector by the low level formatter could not be
  227.        found.  This usually indicates a disk which has suffered
  228.        electrical or physical damage; see the comments under Sector not
  229.        found.  This error also will be reported when trying to access an
  230.        unformatted disk or possibly one with a foreign format.  
  231.  
  232.        Bad drive or command - An invalid drive number or command was
  233.        sent to the bios disk driver.
  234.  
  235.  
  236.  
  237.                                        4
  238.  
  239.  
  240.  
  241.  
  242.  
  243.        Version 1.1 adds a report of the command and disk area causing
  244.        the error.
  245.  
  246.  
  247.        ERRMON is (C) Copyright 1985 by Robert J. Newton, but hereby
  248.        released to the public domain for private non-commercial use.  It
  249.        may be freely copied and distributed, but no consideration may be
  250.        requested other than any customary handling fees charged by
  251.        recognized user's groups.  No warranties of any kind are provided
  252.        and by using the program the user assumes all risk.
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.                                        5